package com.test.flink_source;

import com.test.flink_source.source.MyRichSource;
import com.test.flink_source.source.MySource;
import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class F06MySource {

    public static void main(String[] args) throws Exception {
        Configuration configuration = new Configuration();
        configuration.setInteger("rest.port", 8888);
        StreamExecutionEnvironment webUI = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(configuration);

//        MySource mySource = new MySource();
        MyRichSource mySource = new MyRichSource();

        DataStreamSource<String> dss = webUI.addSource(mySource);
        dss.print();


        webUI.execute();

    }
}
